package org.example.demo.service.userService.impl;

import org.example.demo.dto.SuggestionParam;
import org.example.demo.service.userService.FeedBackService;
import org.example.mbg.mapper.FeedbackMapper;
import org.example.mbg.model.Feedback;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class FeedBackServiceImpl implements FeedBackService {

    @Autowired
    FeedbackMapper feedbackMapper;

    @Override
    public String UploadFeedBack(SuggestionParam suggestionParam) {
        Feedback feedback = new Feedback();
        feedback.setUserId(suggestionParam.getUser_id());
        feedback.setOpinion(suggestionParam.getContent());
        feedback.setFeedbackTime(new Date());
        feedback.setAudit(0);
        feedbackMapper.insertSelective(feedback);
        return "ok";
    }
}
